<template>
    <div class="search-box">
        <el-icon color="#999" size="18px">
            <Search />
        </el-icon>
        <input v-model="keyword" type="text" placeholder="搜索您喜欢的..." />
        <div class="search-btn" @click="onSearch">搜索</div>
    </div>
</template>
<script setup>
import { useContent } from ".";
import { Search } from "@element-plus/icons-vue";

const { keyword, onSearch } = useContent();
</script>
<style lang="scss" scoped>
.search-box {
    width: 800px;
    height: 50px;
    background: #fff;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.21);
    border-radius: 12px;
    overflow: hidden;

    display: flex;
    align-items: center;
    margin: 10px auto;
    padding: 0 0 0 15px;
    z-index: 9;

    input {
        width: 100%;
        height: 30px;
        padding: 0 15px;
        border: none;
        font-size: 16px;

        &:focus {
            outline: none;
            border: none;
        }
    }

    .search-btn {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 97px;
        height: 46px;
        background: #5085fb;
        border-radius: 12px;
        margin-right: 2px;
        font-size: 18px;
        color: #ffffff;
        line-height: 30px;
        cursor: pointer;
        user-select: none;
    }
}
</style>
